/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * InternalTaskFrame.java
 *
 * Created on Jun 18, 2009, 4:07:28 PM
 */

package GUI;

import DTO.Task2DTO;

/**
 *
 * @author trquanglong
 */
public class InternalTaskFrame extends javax.swing.JInternalFrame {

    /** Creates new form InternalTaskFrame */
    public InternalTaskFrame() {
        initComponents();
    }

    InternalTaskFrame(Task2DTO task) {
        initComponents();
        txtSubject.setText(task.getSubject());
        txtStatus.setText(task.getStatus());
        txtPriority.setText(task.getPriority());
        txtStartDay.setText(task.getStartedDay());
        txtEndDay.setText(task.getEndDay());
        txtComplete.setText(Integer.toString(task.getComplete()));
        this.setTitle("Task " + Integer.toString(task.getIdTask()));
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        txtSubject = new javax.swing.JLabel();
        txtStartDay = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        txtEndDay = new javax.swing.JLabel();
        txtPriority = new javax.swing.JLabel();
        ds = new javax.swing.JLabel();
        txtStatusss = new javax.swing.JLabel();
        txtStatus = new javax.swing.JLabel();
        txtCompleteasf = new javax.swing.JLabel();
        txtComplete = new javax.swing.JLabel();

        setBorder(javax.swing.BorderFactory.createTitledBorder(""));

        jPanel1.setBackground(new java.awt.Color(180, 170, 170));

        jPanel2.setBackground(new java.awt.Color(193, 176, 176));

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 38, Short.MAX_VALUE)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 171, Short.MAX_VALUE)
        );

        txtSubject.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
        txtSubject.setForeground(new java.awt.Color(108, 75, 170));
        txtSubject.setText("jLabel1");

        txtStartDay.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        txtStartDay.setForeground(new java.awt.Color(131, 50, 73));
        txtStartDay.setText("jLabel2");

        jLabel3.setText("to");

        txtEndDay.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        txtEndDay.setForeground(new java.awt.Color(131, 50, 73));
        txtEndDay.setText("jLabel2");

        txtPriority.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        txtPriority.setForeground(new java.awt.Color(131, 50, 73));
        txtPriority.setText("jLabel2");

        ds.setText("Priority");

        txtStatusss.setText("Status");

        txtStatus.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        txtStatus.setForeground(new java.awt.Color(131, 50, 73));
        txtStatus.setText("jLabel2");

        txtCompleteasf.setText("Complete");

        txtComplete.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        txtComplete.setForeground(new java.awt.Color(131, 50, 73));
        txtComplete.setText("jLabel2");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtCompleteasf, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(txtStartDay, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel3))
                            .addComponent(ds, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtStatusss, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(22, 22, 22)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtEndDay, javax.swing.GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE)
                            .addComponent(txtComplete, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtStatus, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtPriority, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(txtSubject, javax.swing.GroupLayout.DEFAULT_SIZE, 303, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(txtSubject, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                        .addGap(26, 26, 26)
                        .addComponent(txtPriority))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtStartDay)
                            .addComponent(txtEndDay)
                            .addComponent(jLabel3))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(ds)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtStatusss)
                    .addComponent(txtStatus))
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(13, 13, 13)
                        .addComponent(txtCompleteasf))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txtComplete)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel ds;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JLabel txtComplete;
    private javax.swing.JLabel txtCompleteasf;
    private javax.swing.JLabel txtEndDay;
    private javax.swing.JLabel txtPriority;
    private javax.swing.JLabel txtStartDay;
    private javax.swing.JLabel txtStatus;
    private javax.swing.JLabel txtStatusss;
    private javax.swing.JLabel txtSubject;
    // End of variables declaration//GEN-END:variables

}
